feat: add start-only mode to keep Connect running#41
Merged
nealrichardson merged 5 commits intomainfrom Feb 3, 2026
Merged
Conversation
When no command is provided after `--`, outputs JSON credentials (api_key, server, container_id) and keeps the container running. Adds `--stop` flag to stop a running container by ID. For GitHub Actions, adds outputs (api-key, server, container-id) and a stop input, enabling multi-step workflows. Closes #9 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add test-action-start-only CI job that verifies outputs and stop - Document --stop CLI option - Document start-only mode for CLI - Update GitHub Action inputs table (command now optional, add stop) - Add GitHub Action outputs table - Add multi-step workflow example Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Progress and diagnostic messages now go to stderr, leaving stdout clean for machine-readable output (JSON in start-only mode). This follows Unix conventions where stderr is used for diagnostic output, similar to curl, wget, git, etc. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
Author
|
@tdstein this is ready for review 🙏 |
tdstein
approved these changes
Jan 30, 2026
Comment on lines
89
to
101
| # Check if command is provided | ||
| if [ -z "${{ inputs.command }}" ]; then | ||
| # Start-only mode: capture JSON output and set outputs | ||
| OUTPUT=$(with-connect $ARGS) | ||
| echo "api-key=$(echo "$OUTPUT" | jq -r '.api_key')" >> $GITHUB_OUTPUT | ||
| echo "server=$(echo "$OUTPUT" | jq -r '.server')" >> $GITHUB_OUTPUT | ||
| echo "container-id=$(echo "$OUTPUT" | jq -r '.container_id')" >> $GITHUB_OUTPUT | ||
| else | ||
| # Run with command | ||
| with-connect $ARGS -- bash <<'SCRIPT' | ||
| ${{ inputs.command }} | ||
| SCRIPT | ||
| fi |
Contributor
There was a problem hiding this comment.
nit; is there a way to print these as bash variables so that one doesn't have to use jq to parse it.
Something like...
with-connect $ARGS | with-connect -- bash <<'SCRIPT'
${{ inputs.command }}
SCRIPT
Collaborator
Author
There was a problem hiding this comment.
Thanks for the suggestion, I did that, have a look and see what you think
Contributor
There was a problem hiding this comment.
Nice! Looks great to me. Thanks!
- Output shell variables instead of JSON (CONNECT_API_KEY, CONNECT_SERVER, CONTAINER_ID) - --stop without argument now uses CONTAINER_ID env var - Update action.yml to parse shell format (no jq dependency) - Update README with eval example Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5800b27 to
43dad2b
Compare
Output names now match env var names (CONNECT_API_KEY, CONNECT_SERVER, CONTAINER_ID), allowing direct piping to GITHUB_OUTPUT without parsing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--, outputs JSON credentials (api_key,server,container_id) and keeps the container running--stop <container_id>flag to stop a running containerapi-key,server,container-id) and astopinputCloses #9
Usage
CLI - Start only:
with-connect --license ./rstudio-connect.lic # Outputs: {"api_key": "...", "server": "http://localhost:3939", "container_id": "..."}CLI - Stop:
GitHub Action:
Test plan
--stopargument appears in--help--stopwith nonexistent container returns error🤖 Generated with Claude Code